
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>



<!-- 部门管理 -->
<div role="tabpanel" class="tab-pane" id="departmentcaozuo">
	<div class="check-div form-inline">
		
	
		<div class="col-xs-11">
		<form action="gotoLikeselecttoindexGTFTG" method="post">
		<c:if test="${shenfen==6}">
	
		<span style="position:fixed; left:13%;">校区</span><select class="form-control input-sm  campusidrwwqqsss" name="cassmpus"  style="position:fixed;left:15%;top:20px;">
		<option value=0  >全部</option>
			<c:forEach var="valuew" items="${mycampuslist}">
					<c:if test="${fourtouserGTFTG!=null}">
						<c:if test="${fourtouserGTFTG==valuew.id}">
							<option value=${valuew.id} selected="selected" >${valuew.campusname}</option>
						</c:if>
						<c:if test="${fourtouserGTFTG!=valuew.id}">
							<option value=${valuew.id} >${valuew.campusname}</option>
						</c:if>
					</c:if>
					
						<c:if test="${fourtouserGTFTG==null}">
						<option value=${valuew.id} >${valuew.campusname}</option>
						</c:if>
					
						</c:forEach>
		</select>

	
				<button class="btn btn-primary btn-sm fughyt"  style="position:fixed; top:19px;left:23%;"  type="submit"  >查 询</button>
			
				</c:if>
				
				<script type="text/javascript">
				$(function(){
					
					$(".campusidr").change(function(){
					
						   $.getJSON("genjucidquzhaodid",{"cid":$(this).val()},function(result){
							   
							   console.log(result);
						    	var str="";
						    	 $(".sweds").html("");
						    	 str+= "<option value=0>全部</option>";
						    	 $.each(result,function(i){
						    	
						    	 str+= "<option value="+this.id+">"+this.departmentname+"</option>";
						    	 
						    	 });
						    	
						    	$(".sweds").html(str);
							   
						   });
						
					});
					
					
					
					
				});
				</script>
				
				<c:if test="${shenfen!=6}">
	
		<span style="position:fixed; left:13%;">校区</span><select  disabled="disabled" class="form-control input-sm  campusidrwwqqsss" name="cassmpus"  style="position:fixed;left:15%;top:20px;color: #696969;">
		<option value=0  >全部</option>
			<c:forEach var="valuew" items="${mycampuslist}">
				
						<c:if test="${user.campusid==valuew.id}">
							<option value=${valuew.id} selected="selected" >${valuew.campusname}</option>
						</c:if>
				
						</c:forEach>
		</select>
			
				</c:if>
			</form>
		</div>
		<button class="btn btn-yellow btn-xs" data-toggle="modal"
			data-target="#adddeparment" id="addCourses" style="position: fixed; top: 20px; right: 10%;">添加部门</button>
			<button class="btn btn-yellow btn-xs" data-toggle="modal"
			data-target="#adddeparmentsss11qqww" id="addCoursessss" style="position: fixed; top: 20px; right: 5%;">添加校区</button>
		
	</div>
	
	
	
<c:if test="${shenfen==6}">
	<div class="data-div">
		<div class="row tableHeader">
			<div class="col-xs-3 ">部门</div>
			
			<div class="col-xs-7">校区</div>
		
			<div class="col-xs-2">操作</div>
		</div>
		<div class="tablebody" >

		

			<c:forEach var="user" items="${DDDD}">
				<div class="row " id="GGGqwewqeG">
					<div class="col-xs-3 " >${user.departmentname }</div>
					<div class="col-xs-7 phone"  >${user.campusname}</div>
					<div class="xjj"  style="display: none;">${user.id}</div>
				<div class="xjjj"  style="display: none;">${user.campusid}</div>
				
					<div class="col-xs-2" id="go">
						
						<button class="btn btn-danger btn-xs  deluserhahasssss" 
						>删除</button>
					</div>
				</div>



			</c:forEach>




		</div>

	</div>
	</c:if>
<c:if test="${shenfen!=6}">
<div class="data-div">
		<div class="row tableHeader">
			<div class="col-xs-3 ">部门</div>
			
			<div class="col-xs-7">校区</div>
		
			<div class="col-xs-2">操作</div>
		</div>
		<div class="tablebody" >

		


			<c:forEach var="user" items="${DDDD}">
				<div class="row " id="GGGqwewqeG">
					<div class="col-xs-3 " >${user.departmentname }</div>
					<div class="col-xs-7 phone"  >${user.campusname}</div>
					<div class="xjj"  style="display: none;">${user.id}</div>
					<div class="xjjj"  style="display: none;">${user.campusid}</div>
				
					<div class="col-xs-2" id="go">
						
						<button class="btn btn-danger btn-xs  deluserhahasssss" 
						>删除</button>
					</div>
				</div>



			</c:forEach>




		</div>

	</div>
</c:if>
<script type="text/javascript">
$(function(){
	$(".deluserhahasssss").click(function(){
		
	
		window.location.href="asdsadsadsadasqwqevvzzzz?campusid="+$(this).parent().parent().children(".xjj").text().trim()+"&departmentid="+$(this).parent().parent().children(".xjjj").text().trim()+"&index="+$("#pageGGQQWW").val().trim();
	
	})
	
})
</script>
	<!--页码块-->
	<footer class="footer">
		<ul class="pagination">
			<li><select  id="pageGGQQWW" id="selectpages" >
			
		<c:forEach var="count"  items="${fenyejihedashazi}"   >
	       <c:if test="${fenyededangqianyeo!=nul}">
	       <c:if test="${fenyededangqianyeo==count }">
	        <option value="${count}"  selected="selected">${count}</option>
	       </c:if>
	       <c:if test="${fenyededangqianyeo!=count }">
	        <option value="${count}"  >${count}</option>
	       </c:if>
	       </c:if>
					<c:if test="${fenyededangqianyeo==nul}">
					    <option value="${count}"  >${count}</option>
					</c:if>
	
	</c:forEach>
			
			</select> 页</li>
			<li class="gray">共${fenyezongyeshuya}页</li>
			<li><i class="glyphicon glyphicon-menu-left" id="topqq"> </i>
			</li>
			<li><i class="glyphicon glyphicon-menu-right" id="bottomqq"> </i>
			</li>
		</ul>
	</footer>
<script type="text/javascript">
$(function(){
	$("#pageGGQQWW").change(function(){
		var index=$(this).val();
		window.location.href="goFenYe_getUserGG?index="+index;
	});
	var cap=0;
	var page=0;
$("#topqq").click(function(){
if($("#pageGGQQWW").val()!=1){
	cap=$("#pageGGQQWW").val();
	
	page=parseInt(cap)-1;
	window.location.href="goFenYe_getUserGG?index="+page;
}else{
	cap=$("#pageGGQQWW").val();
	page=cap;

}
});
$("#bottomqq").click(function(){
	if($("#pageGGQQWW").val()=="${fenyezongyeshuya}"){
		cap=$("#pageGGQQWW").val();
		page=cap;
	
	}else{
		cap=$("#pageGGQQWW").val();
		page=parseInt(cap)+1;
		window.location.href="goFenYe_getUserGG?index="+page;	
	}
	
	});

$(".addType_butt").click(function() {
	//按钮名称
	var butStr=$(this).val().trim();
		if(butStr=="添加新部门"){
		$("#department_select").hide();
		$("#department_input").show();
		$(this).val("选择部门");
		
		}else{
		$("#department_input").hide();
		$("#department_select").show();
		$(this).val("添加新部门");
		$("#department_input").val("");
		}
	});

   $("#addCourses").click(function(){
	
	 
	    $.getJSON("zuihouyitianxiedemokuai",{"campusid":$("#yaoyaoqiekenao").val()},function(result){
	    	console.log(result);
	    	var str="";
	    	 $.each(result,function(i){
	    //	alert(result.departmentname);
	    	 str+="<option value="+result[i].id+">"+result[i].departmentname+"</option>";
	    	 });
	    	$("#department_select").html(str);
	    	
	    	
	    })
	  
	   
	   })

 $("#yaoyaoqiekenao").change(function(){
	  $.getJSON("zuihouyitianxiedemokuai",{"campusid":$("#yaoyaoqiekenao").val()},function(result){
	    	console.log(result);
	    	var str="";
	    	 $.each(result,function(i){
	    //	alert(result.departmentname);
	    	 str+="<option value="+result[i].id+">"+result[i].departmentname+"</option>";
	    	 });
	    	$("#department_select").html(str);
	    	
	    	
	    })
   
   })

});

</script>

</div>
<div class="modal fade" id="adddeparmentsss11qqww" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		
	
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					
					<h4 class="modal-title" id="gridSystemModalLabel">添加校区</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<form class="form-horizontal" id="aoyexiedaimazhendezhendehaolei" action="welingyiqinianxiedetianjiaxiaoquxiwangkeyinadiyiranhounaqianhaohaochiyidun" method="POST">
							<div class="form-group ">
							
						
								
								
								<label for="sName" class="col-xs-3 control-label" style="">校区：</label>
						      	<div class="col-xs-6 ">
							<input type="text" name="campusnamessGGFF" 
									class="form-control input-sm duiqi" > 
							</div>
										
							</div>
					

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-green "  onclick="submitaoyexiedaimazhendezhendehaolei()">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>

		
		<!-- /.modal-dialog -->
	</div>
<div class="modal fade" id="adddeparment" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		
	
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					
					<h4 class="modal-title" id="gridSystemModalLabel">添加部门</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<form class="form-horizontal" id="aoyexiedaimazhendezhendehaolei" action="aoyexiedaimazhendezhendehaolei" method="POST">
							<div class="form-group ">
								<label for="sName" class="col-xs-3 control-label">部门：</label>
								<div class="col-xs-6 ">
								    <select class="form-control input-sm duiqi" name ="croudfgidqwsazxcde" id="department_select"  placeholder="">
								   
								    </select>
								
									<input type="text" class="form-control input-sm duiqi" 
										id="department_input" style="display: none;" name="coursesTexsdasdsadwqet">
									<input type="button" value="自定义课程" class="addType_butt" style="float: right;margin-top: -9.5%;margin-right: 10%;">
								</div>
								
								
									<c:if test="${shenfen==6}">
								<label for="sName" class="col-xs-3 control-label" style="position:relative;left:-500px;top:45px; ">校区：</label>
						      	<div class="col-xs-6 ">
							   <select class="form-control input-sm duiqi" name ="croudfgiduuyy" id="yaoyaoqiekenao"  style="position: relative;left:55%;" placeholder="">
								   	<c:forEach var="valuew" items="${mycampuslist}">
							    <option value=${valuew.id} >${valuew.campusname}</option>			
						           </c:forEach>
								    </select>						
							</div>
								</c:if>					
							</div>
					

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-green "  onclick="submitaoyexiedaimazhendezhendehaolei()">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>

		
		<!-- /.modal-dialog -->
	</div>
	<script type="text/javascript">
	function submitaoyexiedaimazhendezhendehaolei(){
		$("#aoyexiedaimazhendezhendehaolei").submit();
		
		}
</script>



<!-- 部门管理模块 -->
<div role="tabpanel" class="tab-pane" id="char">
	
	<div class="check-div">
		<button class="btn btn-yellow btn-xs" data-toggle="modal"
			data-target="#addChar" id="addCourse">添加课程</button>
		
		
			<c:if test="${shenfen==3}">
	<select class="btn btn-black btn-xs" style="margin-left: 10%;" id="department-sel"  >
	
			<c:forEach var="v" items="${d}">
			   <c:if test="${shenfenbumen==v.id}">
				<option value=${v.id}  selected="selected" >${v.departmentname}</option>
			</c:if>
			</c:forEach>
		</select>	
		</c:if>
		
		<c:if test="${shenfen!=3}">
		<select class="btn btn-yellow btn-xs" style="margin-left: 10%;" id="department-sel" >
			<option value=0>所有部门</option>
			<c:forEach var="v" items="${d}">
			   
				<option value=${v.id} >${v.departmentname}</option>
			
			</c:forEach>
		</select>	
		</c:if>
		
	</div>
	
	<div class="data-div">
		<div class="row tableHeader">
			<div class="col-xs-1 ">编码</div>
			<div class="col-xs-4">课程名</div>
			<div class="col-xs-4">所属部门</div>
			<div class="col-xs-2">操作</div>
		</div>
		<div class="tablebody">
			
			
			<c:forEach var="department" items="${ departmentList}">
				<c:forEach var="course" items="${department.coureses }">
					<div class="row">
						<div class="col-xs-1 ">${ course.id}</div>
						<div class="col-xs-4">
							<span>${ course.courseName}</span>
						</div>
						<div class="col-xs-4">${ department.departmentname}</div>
						<div class="col-xs-2">
							<%-- <button class="btn btn-success btn-xs" data-toggle="modal"
									data-target="#changeChar" onclick="a('${department}')">修改</button> --%>
							<button class="btn btn-danger btn-xs" data-toggle="modal"
									data-target="#deleteChar">删除</button>
						</div>
					</div>
				</c:forEach>
			
			
			</c:forEach>
		

		</div>

	</div>
	<!--页码块-->
	<footer class="footer">
		<ul class="pagination">
			<li>当前第
			<select id="courses-page">
					<c:forEach var="i" items="${coursesPage.pageList }">
						<option value="${i }">${i}</option>
					</c:forEach>
			</select> 页</li>
			<li class="gray">共${coursesPage.countPage }页</li>
			<a href="${pageContext.request.contextPath }/getConstruction2?indexPage=${coursesPage.index-1}&departmentId=${departmentId}">
				<li><i id="courses-up" class="glyphicon glyphicon-menu-left" > </i></li>
			</a>
			<a href="${pageContext.request.contextPath }/getConstruction2?indexPage=${coursesPage.index+1}&departmentId=${departmentId}">
				<li><i id="courses-below" class="glyphicon glyphicon-menu-right"> </i></li>
			</a>
		</ul>
	</footer>
	
	<!--添加课程弹出窗口-->
	<div class="modal fade" id="addChar" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		
	
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">添加课程</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<form class="form-horizontal" id="addCampusCourses" action="${pageContext.request.contextPath }/addCampusCourses" method="POST">
							<div class="form-group ">
								<label for="sName" class="col-xs-3 control-label">课程名：</label>
								<div class="col-xs-6 ">
								    <select class="form-control input-sm duiqi" name ="coursesId" id="sName_select"  placeholder="">
								    </select>
									<input type="text" class="form-control input-sm duiqi" 
										id="sName_input" style="display: none;" name="coursesText">
									<input type="button" value="自定义课程" class="addType_but" style="float: right;margin-top: -9.5%;margin-right: 10%;">
								</div>
							</div>
							<div class="form-group">
								<label for="sLink" class="col-xs-3 control-label">描述：</label>
								<div class="col-xs-6 ">
									<textarea class="form-control input-sm duiqi" name="code"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label for="sOrd" class="col-xs-3 control-label">所在部门：</label>
								<div class="col-xs-6">
									<select type="" class="form-control input-sm duiqi" id="sOrd"
										placeholder="" name="departmentId">
										<c:forEach var="v" items="${d}">
											<option value=${v.id} >${v.departmentname}</option>
										</c:forEach>
									</select>
								</div>
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-green" onclick="submitCourses()">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>

		
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

	<!--修改课程弹出窗口-->
	<div class="modal fade" id="changeChar" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">修改课程</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<form class="form-horizontal">
							<div class="form-group ">
								<label for="sName" class="col-xs-3 control-label">课程名：</label>
								<div class="col-xs-6 ">
									<input type="email" class="form-control input-sm duiqi"
										id="sName" placeholder="">
								</div>
							</div>
							<div class="form-group">
								<label for="sLink" class="col-xs-3 control-label">描述：</label>
								<div class="col-xs-6 ">
									<textarea class="form-control input-sm duiqi"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label for="sOrd" class="col-xs-3 control-label">所在部门 ：</label>
								<div class="col-xs-6">
									<select type="" class="form-control input-sm duiqi" id="sOrd"
										placeholder="">
									</select>
								</div>
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-green">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

	<!--弹出删除权限警告窗口-->
	<div class="modal fade" id="deleteChar" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">提示</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">确定要删除该权限？删除后不可恢复！</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-danger">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

</div>
<script type="text/javascript">
	
	//添加课程事件
	function submitCourses(){
	$("#addCampusCourses").submit();
	
	}
    
    //修改课程
    function a(node){
    	$.ajax({
    	url:"${pageContext.request.contextPath }/getCoursesBUNull",
    	type:"POST",
    	
    	
    	});
    
    }



	$(function(){
		$("#courses-page").val("${coursesPage.index}");
		$("#department-sel").val("${departmentId}");
		
		
		$("#courses-page").change(function(){
			var index = $(this).val();
			window.location.href="${pageContext.request.contextPath }/getConstruction2?indexPage="
			+index+"&departmentId=${departmentId}";
		});
		
		$("#department-sel").change(function(){
			var id = $(this).val();
			
			window.location.href="${pageContext.request.contextPath }/getConstruction2?departmentId="+id+"&indexPage=1";
		});
		
		
		//切换课程名称的选择方式
		$(".addType_but").click(function() {
		//按钮名称
		var butStr=$(this).val().trim();
			if(butStr=="添加新课程"){
			$("#sName_select").hide();
			$("#sName_input").show();
			$(this).val("选择课程");
			
			}else{
			$("#sName_input").hide();
			$("#sName_select").show();
			$(this).val("添加新课程");
			$("#sName_input").val("");
			}
		});
		
		
		 $("#addCourse").click(function(){
		 	$.ajax({
		 		url:"${pageContext.request.contextPath }/getCoursesBUNull",
		 		type:"POST",
		 		dataType:"JSON",
		 		success:function(data){
		 		
		 			$.each(data,function(){
		 				$("#sName_select").append("<option value="+this.id+">"+this.courseName+"</option>");
		 			
		 			});
		 		
		 		},
		 		error:function(){
		 		
		 		}
		 	
		 	});
		 
		 });
	
	});
	


</script>














<!-- 课程管理模块 -->
<div role="tabpanel" class="tab-pane" id="char">

	<div class="check-div">
		<button class="btn btn-yellow btn-xs" data-toggle="modal"
			data-target="#addChar">添加课程</button>



		<select class="btn btn-yellow btn-xs" style="margin-left: 10%;"
			id="department-sel">
			<option value=0>所有部门</option>
			<option value=""></option>
			<c:forEach var="v" items="${d}">

				<option value=${v.id} >${v.departmentname}</option>
			</c:forEach>
		</select>

	</div>
	</form>
	<div class="data-div">
		<div class="row tableHeader">
			<div class="col-xs-1 ">编码</div>
			<div class="col-xs-4">课程名</div>
			<div class="col-xs-4">所属部门</div>
			<div class="col-xs-2">操作</div>
		</div>
		<div class="tablebody">


			<c:forEach var="department" items="${ departmentList}">
				<c:forEach var="course" items="${department.coureses }">
					<div class="row">
						<div class="col-xs-1 ">${ course.id}</div>
						<div class="col-xs-4">
							<span>${ course.courseName}</span>
						</div>
						<div class="col-xs-4">${ department.departmentname}</div>
						<div class="col-xs-2">
							<button class="btn btn-success btn-xs" data-toggle="modal"
								data-target="#changeChar">修改</button>
							<button class="btn btn-danger btn-xs" data-toggle="modal"
								data-target="#deleteChar">删除</button>
						</div>
					</div>
				</c:forEach>


			</c:forEach>


		</div>

	</div>
	<!--页码块-->
	<footer class="footer">
		<ul class="pagination">
			<li>当前第 <select id="courses-page">
					<c:forEach var="i" items="${coursesPage.pageList }">
						<option value="${i }">${i}</option>
					</c:forEach>
			</select> 页
			</li>
			<li class="gray">共${coursesPage.countPage }页</li>
			<a
				href="${pageContext.request.contextPath }/getConstruction2?indexPage=${coursesPage.index-1}&departmentId=${departmentId}">
				<li><i id="courses-up" class="glyphicon glyphicon-menu-left">
				</i></li>
			</a>
			<a
				href="${pageContext.request.contextPath }/getConstruction2?indexPage=${coursesPage.index+1}&departmentId=${departmentId}">
				<li><i id="courses-below"
					class="glyphicon glyphicon-menu-right"> </i></li>
			</a>
		</ul>
	</footer>

	<!--添加课程弹出窗口-->
	<div class="modal fade" id="addChar" role="dialog"
		aria-labelledby="gridSystemModalLabel">


		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">添加课程</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<form class="form-horizontal" id="addCampusCourses"
							action="${pageContext.request.contextPath }/addCampusCourses"
							method="post" accept-charset="UTF-8">
							<div class="form-group ">
								<label for="sName" class="col-xs-3 control-label">课程名：</label>
								<div class="col-xs-6 ">
									<select class="form-control input-sm duiqi" name="id"
										id="sName_select" placeholder="">
										<option value=1>1</option>
										<option value=2>2</option>
										<option value=3>3</option>
										<option value=4>4</option>
									</select> <input type="text" class="form-control input-sm duiqi"
										id="sName_input" style="display: none;" name="coursesText">
									<input type="button" value="添加新课程" class="addType_but">
								</div>
							</div>
							<div class="form-group">
								<label for="sLink" class="col-xs-3 control-label">描述：</label>
								<div class="col-xs-6 ">
									<textarea class="form-control input-sm duiqi" name="info"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label for="sOrd" class="col-xs-3 control-label">所在部门：</label>
								<div class="col-xs-6">
									<select type="" class="form-control input-sm duiqi" id="sOrd"
										placeholder="" name="departmentId">
										<c:forEach var="v" items="${d}">
											<option value=${v.id} >${v.departmentname}</option>
										</c:forEach>
									</select>
								</div>
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-green"
						onclick="submitCourses()">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>


		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

	<!--修改课程弹出窗口-->
	<div class="modal fade" id="changeChar" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">修改课程</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						<form class="form-horizontal">
							<div class="form-group ">
								<label for="sName" class="col-xs-3 control-label">课程名：</label>
								<div class="col-xs-6 ">
									<input type="email" class="form-control input-sm duiqi"
										id="sName" placeholder="">
								</div>
							</div>
							<div class="form-group">
								<label for="sLink" class="col-xs-3 control-label">描述：</label>
								<div class="col-xs-6 ">
									<textarea class="form-control input-sm duiqi"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label for="sOrd" class="col-xs-3 control-label">所在部门 ：</label>
								<div class="col-xs-6">
									<select type="" class="form-control input-sm duiqi" id="sOrd"
										placeholder="">
									</select>
								</div>
							</div>

						</form>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-green">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

	<!--弹出删除权限警告窗口-->
	<div class="modal fade" id="deleteChar" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">提示</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">确定要删除该权限？删除后不可恢复！</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
					<button type="button" class="btn btn-xs btn-danger">保 存</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

</div>
<script type="text/javascript">
	//添加课程事件
	function submitCourses() {
		$("#addCampusCourses").submit();

	}

	$(function() {
		$("#courses-page").val("${coursesPage.index}");
		$("#department-sel").val("${departmentId}");

		$("#courses-page")
				.change(
						function() {
							var index = $(this).val();
							window.location.href = "${pageContext.request.contextPath }/getConstruction2?indexPage="
									+ index + "&departmentId=${departmentId}";
						});

		$("#department-sel")
				.change(
						function() {
							var id = $(this).val();

							window.location.href = "${pageContext.request.contextPath }/getConstruction2?departmentId="
									+ id + "&indexPage=1";
						});

		//切换课程名称的选择方式
		$(".addType_but").click(function() {
			//按钮名称
			var butStr = $(this).val().trim();
			if (butStr == "添加新课程") {
				$("#sName_select").hide();
				$("#sName_input").show();
				$(this).val("从以前课程中选择");

			} else {
				$("#sName_input").hide();
				$("#sName_select").show();
				$(this).val("添加新课程");
				$("#sName_input").val("");
			}
		});

	});
</script>






<div role="tabpanel" class="tab-pane" id="a">
<div style="height: 30px;"></div>
<div class="row " >
<div class='col-lg-10 col-md-10 col-sm-10 col-xs-10'>
                <span style="position: relative;left:3%;">
                                            校区: <select class="btn btn-yellow btn-xs" id="xq_grade"
				style="cursor:default;width:6.5%;" name="courses_xq">
				<c:forEach var="campus" items="${sessionScope.campusList}" >
				<option value="${campus.id}">${campus.campusname}</option>
				</c:forEach>
			    </select>
				</span>
				 <span style="position: relative;left:8%;">
                                            部门: <select class="btn btn-yellow btn-xs" id="bm_grade"
				style="cursor:default;width:6.5%;" name="courses_bm">
				<c:forEach var="depa" items="${sessionScope.depaList}" >
				<option value="${depa.id}">${depa.departmentname}</option>
				</c:forEach>
			    </select>
				</span>
				<c:if test="${user.roleid==6}">
						<button class="btn btn-warning btn-xs" 
							data-toggle='modal' data-target='#addgrade'
							 style="position: relative;left: 9%;" id="newGrade">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新班级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
					</c:if>
					<c:if test="${user.roleid==1}">
						<button class="btn btn-warning btn-xs" 
							data-toggle='modal' data-target='#addgrade'
							 style="position: relative;left: 9%;" id="meGrade">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我的班级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
					</c:if>
</div>
</div>
<div style="height: 20px;"></div>
	<div class="row " >

		<div class='col-lg-11 col-md-11 col-sm-11 col-xs-11'>
			<!--编号  -->
			<span style="position: relative;left:3%;">
			班级编号: <input placeholder="班级编号" id="bh_grade"
				style="cursor:text;width:8%;height:20px;border:0px;"  />
				</span>
		

		<!--部门  -->
		<span style="position: relative;left:5%;">
			班级课程: <select class="btn btn-yellow btn-xs" id="kc_grade"
				style="cursor:default;width:6.5%;" name="courses_gre">
				<option value="">全部</option>
				<c:forEach var="cour" items="${sessionScope.CourList}" >
				<option value="${cour.id}">${cour.courseName}</option>
				</c:forEach>
			</select>
		</span>
		<span style="position: relative;left:5%;">
			教员老师: <select class="btn btn-yellow btn-xs"
				style="cursor:default;width:6.5%;" name="teacher_jy" id="jy_select">
				<option value="">全部</option>
			</select> <input class=""
				style="margin-left:0.1%;cursor:text;width:7.15%;height:20px;border:0px;display: none;"
				name="" id="jy_input" />
			<button class="btn btn-danger btn-xs" name="jy_but" style="position: relative;left:0.1%;">手动输入</button>
		 </span>
		 <span style="position: relative;left:5.75%;">
			班主任: <select class="btn btn-yellow btn-xs" id="bzr_grade"
				style="margin-left: 0.1%;cursor:default;width:6.5%;"
				name="teacher_bzr" >
				<option value="">全部</option>
				<c:forEach var="bzr" items="${sessionScope.bzrList}" >
				<option value="${bzr.id}">${bzr.teachername}</option>
				</c:forEach>
			</select> <input class=""
				style="margin-left:0.1%;cursor:text;width:7.15%;height:20px;border:0px;display: none;"
				name="" id="bzr_input" />
			<button class="btn btn-danger btn-xs" name="bzr_but">手动输入</button>
		</span>
		 <span style="position: relative;left:6.8%;">
			就业老师: <select class="btn btn-yellow btn-xs"
				style="margin-left: 0.1%;cursor:default;width:6.5%;"
				name="teacher_joy" id="joy_select">
				<option value="">全部</option>
				<c:forEach var="job" items="${sessionScope.jobList}" >
				<option value="${job.id}">${job.teachername}</option>
				</c:forEach>
			</select> <input class=""
				style="margin-left:0.1%;cursor:text;width:7.15%;height:20px;border:0px;display: none;"
				name="" id="joy_input" />
			<button class="btn btn-danger btn-xs" name="joy_but">手动输入</button>
		</span>
		<span style="position: relative;left:7.2%;">
			班级状态: <select class="btn btn-yellow btn-xs"
				style="margin-left: 0.1%;cursor:default;width:6.5%;"
				name="status_gre" id="zt_grade">
				<option value="">全部</option>
				<option value="0">待定班级</option>
				<option value="1">正式班级</option>
				<option value="2">毕业班级</option>
			</select>
		</span>
		</div>
		</div>
		<div style="height: 12px;"></div>
      
			<div class="row">
				<div class='col-lg-10 col-md-10 col-sm-10 col-xs-10'>
				<input id="GraGetData_sub"  class="btn btn-primary btn-xs" id="gra_select_sub" style="position: relative;left: 3.2%;" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;">
					<button class="btn btn-success btn-xs" id="px_by" name="asc" style="position: relative;left: 4.2%;">升序</button>
					<span style="position: relative;left: 7.7%;">
					排序方式: <select class="btn btn-yellow btn-xs"
						style="cursor:default;width:6.5%;" id="px_order">
						<option value="">全部</option>
						<option value="gradecode">编号</option>
						<option value="count">人数</option>
						<option value="status">状态</option>
					</select>
					</span>
				</div>
			</div>
		<div style="height: 12px;"></div>





	<div class="row tableHeader">
		<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
		<span style="position:absolute;left: 1.5%;">
		编码
		</span>
		<span style="position:absolute;left: 12.5%; ">
		课程
		</span>
		<span style="position:absolute;left: 22.5%; ">
		教员
		</span>
		<span style="position:absolute;left: 33.5%; ">
		班主任
		</span>
		<span style="position:absolute;left: 45.5%; ">
		就业老师
		</span>
		<span style="position:absolute;left: 56%; ">
		状态
		</span>
		<span style="position:absolute;left: 66.5%; ">
		人数
		</span>
		<span style="position:absolute;left: 80%; ">
		操作
		</span>
		</div>
	</div>
	
	<div class="tablebody" id="data_body">
	<c:forEach var="grade" items="${sessionScope.Grade_mod_List}">
	<c:choose>
	<c:when test="${grade.status!=0}">
		<div class="row ">
		<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
		<span style="position:absolute;left: -1.5%;width:9%;text-align:center;">
		${grade.gradecode}
		</span>
		<span style="position:absolute;left: 7.5%;width:11%;text-align:center; ">
		${grade.courseName}
		</span>
		<span style="position:absolute;left: 18.5%;width:11%;text-align:center; ">
		${grade.instructorName}
		</span>
		<span style="position:absolute;left: 29.5%;width:11%;text-align:center; ">
		${grade.teacherName}
		</span>
		<span style="position:absolute;left: 41.5%;width:11%;text-align:center; ">
		${grade.jobteacherName}
		</span>
		<span style="position:absolute;left: 52%;width:11%;text-align:center; ">
		<c:if test="${grade.status==0}">
		待定班级
		</c:if>
		<c:if test="${grade.status==1}">
		正式班级
		</c:if>
		<c:if test="${grade.status==2}">
		毕业班级
		</c:if>
		</span>
		<span style="position:absolute;left: 62.5%;width:9%;text-align:center; ">
		${grade.count}
		</span>
		<span style="position:absolute;left: 73.5%;width:22.5%;text-align:center; ">
		<c:if test="${(sessionScope.user.roleid==5||sessionScope.user.roleid==6)}">

								<button class="btn btn-primary btn-xs" data-toggle="modal"
								data-target="#xx" id="xx${grade.gradeno}" name="xx">详细</button>
							
		</c:if>		
		<c:if test="${sessionScope.user.roleid==1&&sessionScope.user.phone==grade.teacherPhone}">
								<button class="btn btn-danger btn-xs" data-toggle="modal"
								data-target="#openGrade" name="openGrade" id="kb${grade.gradeno}">开班</button>
								<button class="btn btn-primary btn-xs" data-toggle="modal"
								data-target="#xx" id="xx${grade.gradeno}" name="xx">详细</button>
		</c:if>					
		<c:if test="${sessionScope.user.roleid==2||sessionScope.user.roleid==4}">
								<button class="btn btn-success btn-xs" name="jumpAddStu" id="${grade.gradeno}/${grade.depaid}/${grade.coursesid}/${grade.campusid}" >添加学生</button>
		</c:if>		
		<c:if test="${sessionScope.user.roleid==3&&sessionScope.user.departmentid==grade.depaid}">
								<button class="btn btn-danger btn-xs" data-toggle="modal"
								data-target="#openGrade" name="openGrade" id="kb${grade.gradeno}">开班</button>
								<button class="btn btn-primary btn-xs" data-toggle="modal"
								data-target="#xx" id="xx${grade.gradeno}" name="xx">详细</button>
		</c:if>											
		</span>
		</div>
	</div>
	</c:when>
	<c:otherwise>
	
	<div class="row ">
		<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
		<span style="position:absolute;left: -1.5%;width:11%;text-align:center;">
		${grade.courCode}
		<c:if test="${grade.gradecode!=1}">
		<input placeholder="${grade.gradecode}"   id="gradeInp_select${grade.gradeno}" value="${grade.gradecode}" name="${grade.courCode}"
				style="cursor:text;width:49px;height:20px;border:0px;background-color:#FCFCFC;"  />
		</c:if>
		<c:if test="${grade.gradecode==1}">
		<input placeholder=""   id="gradeInp_select${grade.gradeno}" value="" name="${grade.courCode}"
				style="cursor:text;width:27px;height:20px;border:0px;background-color:#FCFCFC;"  />
		</c:if>
		</span>
		<span style="position:absolute;left: 7.5%;width:11%;text-align:center; "  >
		${grade.courseName}
		</span>
		<span style="position:absolute;left: 18.5%;width:11%;text-align:center; ">
		<select class="btn btn-yellow btn-xs"  id="gradeInst_select${grade.gradeno}" name="${grade.coursesid}" 
				style="cursor:default;width:60%;background-color: #F0F0F0;" >
				<option value="${grade.instructor}">${grade.instructorName}</option>
		</select>
		</span>
		<span style="position:absolute;left: 29.5%;width:11%;text-align:center; ">
		<select class="btn btn-yellow btn-xs" 
				style="cursor:default;width:60%;background-color: #F0F0F0;" name="${grade.depaid}"   id="gradeTea_select${grade.gradeno}"> 
				<option value="${grade.teacher}">${grade.teacherName}</option>
		</select>
		</span>
		<span style="position:absolute;left: 41.5%;width:11%;text-align:center; ">
		<select class="btn btn-yellow btn-xs" id="gradejob_select${grade.gradeno}"   
				style="cursor:default;width:60%; background-color: #F0F0F0"  >
				<option value="${grade.jobteacher}">${grade.jobteacherName}</option>
		</select>
		</span>
		<span style="position:absolute;left: 52%;width:11%;text-align:center; ">
		<c:if test="${grade.status==0}">
		待定班级
		</c:if>
		<c:if test="${grade.status==1}">
		正式班级
		</c:if>
		<c:if test="${grade.status==2}">
		毕业班级
		</c:if>
		</span>
		<span style="position:absolute;left: 62.5%;width:9%;text-align:center; ">
		${grade.count}
		</span>
		<span style="position:absolute;left: 73.5%;width:22.5%;text-align:center; ">
		<c:if test="${grade.status==0&&(sessionScope.user.roleid==5||sessionScope.user.roleid==6)}">
				<button class="btn btn-warning btn-xs"  id="updateGre${grade.gradeno}" onclick="updateGre(${grade.gradeno})">修改</button>
				<button class="btn btn-info btn-xs"  style="display: none;" id="qx${grade.gradeno}" name="qx" onclick="qx(${grade.gradeno})" >取消</button>
								<button class="btn btn-success btn-xs" 
								 style="display: none;" id="sc${grade.gradeno}" onclick="getCode(${grade.coursesid},${grade.gradeno})">生成编号</button>
								<button class="btn btn-danger btn-xs" data-toggle="modal"
								data-target="#openGrade" name="openGrade" id="kb${grade.gradeno}">开班</button>
		</c:if>
		<c:if test="${(sessionScope.user.roleid==5||sessionScope.user.roleid==6)}">

								<button class="btn btn-primary btn-xs" data-toggle="modal"
								data-target="#xx" id="xx${grade.gradeno}" name="xx">详细</button>
								
		</c:if>		
		<c:if test="${sessionScope.user.roleid==1&&sessionScope.user.phone==grade.teacherPhone}">
								<button class="btn btn-danger btn-xs" data-toggle="modal"
								data-target="#openGrade" name="openGrade" id="kb${grade.gradeno}">开班</button>
								<button class="btn btn-primary btn-xs" data-toggle="modal"
								data-target="#xx" id="xx${grade.gradeno}" name="xx">详细</button>
		</c:if>		
		<c:if test="${sessionScope.user.roleid==3&&sessionScope.user.departmentid==grade.depaid}">
								<button class="btn btn-danger btn-xs" data-toggle="modal"
								data-target="#openGrade" name="openGrade" id="kb${grade.gradeno}">开班</button>
								<button class="btn btn-primary btn-xs" data-toggle="modal"
								data-target="#xx" id="xx${grade.gradeno}" name="xx">详细</button>
		</c:if>					
		<c:if test="${sessionScope.user.roleid==2||sessionScope.user.roleid==4}">
								<button class="btn btn-success btn-xs" name="jumpAddStu" id="${grade.gradeno}/${grade.depaid}/${grade.coursesid}/${grade.campusid}">添加学生</button>
		</c:if>												
		</span>
		</div>
	</div>
	</c:otherwise>
	</c:choose>	
	</c:forEach>
			
	</div>
	<div id="gre_page_">
		<!--页码块-->
		&nbsp;&nbsp;&nbsp;&nbsp; 
		           校区: <span id="xq_sp" name="${sessionScope.xq_id}">${sessionScope.xq}</span>》 
		           部门: <span id="bm_sp" name="${sessionScope.bm_id}">${sessionScope.bm}</span>》 
		           班级编号: <span id="bh_sp" name="${sessionScope.bh_id}">${sessionScope.bh}</span>》 
		           班级课程: <span id="kc_sp" name="${sessionScope.kc_id}">${sessionScope.kc}</span>》 
		           教员老师: <span id="jy_sp" name="${sessionScope.jy_id}">${sessionScope.jy}</span>》 
		           班主任: <span id="bzr_sp" name="${sessionScope.bzr_id}">${sessionScope.bzr}</span>》 
		           就业老师: <span id="job_sp" name="${sessionScope.job_id}">${sessionScope.job}</span>》 
		           班级状态: <span id="zt_sp" name="${sessionScope.zt_id}">${sessionScope.zt}</span>》 
		           排序方式: <span id="px_sp"name="${sessionScope.px_id}">${sessionScope.px}</span>&nbsp;&nbsp;
		          序列:<span id="px_sp"name="${sessionScope.xl_id}">${sessionScope.xl}</span>&nbsp;&nbsp;
		<span id="px_by_sp"></span>
	</div>
	<footer class="footer">
		<ul class="pagination">
			<li>当前第 <select id="graSelectPage" >
					<c:forEach var="p" items="${sessionScope.grepage.pageList }">
						<option value="${p}">${p}</option>
					</c:forEach>
			</select> 页
			</li>
			<li class="gray">共${grepage.countPage}页</li>
			<a
				href="${pageContext.request.contextPath }/AdmGrade?pageIndex=${grepage.index-1}&xq=${sessionScope.xq}&xq_id=${sessionScope.xq_id}&bm=${sessionScope.bm}&bm_id=${sessionScope.bm_id}&bh=${sessionScope.bh}&bh_id=${sessionScope.bh_id}&jy=${sessionScope.jy}&jy_id=${sessionScope.jy_id}&bzr=${sessionScope.bzr}&bzr_id=${sessionScope.bzr_id}&job=${sessionScope.job}&job_id=${sessionScope.job_id}&kc=${sessionScope.kc}&kc_id=${sessionScope.kc_id}&zt=${sessionScope.zt}&zt_id=${sessionScope.zt_id}&px=${sessionScope.px}&px_id=${sessionScope.px_id}&xl=${sessionScope.xl}&xl_id=${sessionScope.xl_id}">
				<li><i id="courses-up" class="glyphicon glyphicon-menu-left">
				</i></li>
			</a>
			<a
				href="${pageContext.request.contextPath }/AdmGrade?pageIndex=${grepage.index+1}&xq=${sessionScope.xq}&xq_id=${sessionScope.xq_id}&bm=${sessionScope.bm}&bm_id=${sessionScope.bm_id}&bh=${sessionScope.bh}&bh_id=${sessionScope.bh_id}&jy=${sessionScope.jy}&jy_id=${sessionScope.jy_id}&bzr=${sessionScope.bzr}&bzr_id=${sessionScope.bzr_id}&job=${sessionScope.job}&job_id=${sessionScope.job_id}&kc=${sessionScope.kc}&kc_id=${sessionScope.kc_id}&zt=${sessionScope.zt}&zt_id=${sessionScope.zt_id}&px=${sessionScope.px}&px_id=${sessionScope.px_id}&xl=${sessionScope.xl}&xl_id=${sessionScope.xl_id}">
				<li><i id="courses-below"
					class="glyphicon glyphicon-menu-right"> </i></li>
			</a>
		</ul>
	</footer>
</div>
<!-- 档案通过 -->
<div class="modal fade" id="upgrade" role="dialog"
	aria-labelledby="passApplyModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">&times;</span>
					<tton>
					<h4 class="modal-title" id="passApplyModalLabel">提示</h4>
			</div>
			<div class="modal-body">
				<div class="container-fluid">
					确定修改吗？<br /> 班级编号:<span class="bj_sp_up"></span><br /> 教员老师:<span
						class="jy_sp_up"></span><br /> 就业老师:<span class="joy_sp_up"></span><br />
					班主任老师:<span class="bzr_sp_up"></span><br /> <span class="id_sp_up"></span>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-xs btn-white"
					data-dismiss="notupgrade">
					取 消
					<tton>
					<button type="button" class="btn  btn-xs btn-danger"
						id="upgrade_yes">
						确 定
						<tton>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
</div>
<!-- 新班级-->
<div class="modal fade" id="addgrade" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">开通班级</h4>
				</div>
				<div class="modal-body">
				<div class="container-fluid">
					开通新班级<br />
	               <div class='col-lg-10 col-md-10 col-sm-10 col-xs-10' style="position: relative;top: 0px">
                <span style="position: relative;left:6%;">
                                            校区: <select class="btn btn-yellow btn-xs" id="xq_add"
				style="cursor:default;width:35%;" >
				<c:forEach var="campus" items="${sessionScope.campusList}" >
				<option value="${campus.id}">${campus.campusname}</option>
				</c:forEach>
			    </select>
				</span>
				</div>
				<br />
				 <div class='col-lg-10 col-md-10 col-sm-10 col-xs-10' style="position: relative;top: 6px;">
				 <span style="position: relative;left:6%;">
                                            部门: <select class="btn btn-yellow btn-xs" id="bm_add"
				style="cursor:default;width:35%;" name="courses_bm">
				<c:forEach var="depa" items="${sessionScope.depaList}" >
				<option value="${depa.id}">${depa.departmentname}</option>
				</c:forEach>
			    </select>
				</span>
				</div>
				<br />
				 <div class='col-lg-10 col-md-10 col-sm-10 col-xs-10' style="position: relative;top: 12px;">
				<span style="position: relative;left:6%;">
			班级课程: <select class="btn btn-yellow btn-xs" id="kc_add"
				style="cursor:default;width:35%;" name="courses_gre">
				<c:forEach var="cour" items="${sessionScope.CourList}" >
				<option value="${cour.id}">${cour.courseName}</option>
				</c:forEach>
			</select>
		</span>
				</div>	

				</div>
			</div>
			<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
						<a  id="addGrade" class="btn btn-xs btn-green">提交</a>
						
				</div>
		</div>
		<!-- /.modal-content -->
	</div>
</div>
<!-- 弹出------------------------------------------------------------------------------------ -->
<!--修改班级弹出窗口-->
	<div class="modal fade" id="upGrade" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">修改班级</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						
							<div class="form-group ">
							   
								<label style="position: absolute;left: 8%">班级编号：<input id="update_code" name="UP_code" value="" style="border: 0px;background-color: #FFFFFF;height:19px;" disabled="disabled"></input></label>
					            <br/>
					             <br/>
					            <label style="position: absolute;left: 8%">班主任：<input id="update_code" name="UP_bzr" value="" style="border: 0px;background-color: #FFFFFF;height:19px;" disabled="disabled"></input></label>
								 <br/>
					             <br/>
					            <label style="position: absolute;left: 8%">教员老师：<input id="update_code" name="UP_jy" value="" style="border: 0px;background-color: #FFFFFF;height:19px;" disabled="disabled"></input></label>
					            <br/>
					            <br/>
					            <label style="position: absolute;left: 8%">就业老师：<input id="update_code" name="UP_job" value="" style="border: 0px;background-color: #FFFFFF;height:19px;" disabled="disabled"></input></label>	
							
							
							</div>
						
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
						<a  id="upGrade_sub" class="btn btn-xs btn-green">提交</a>
						
				</div>

			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->
	<!--开班的弹出窗口-->
		<div  class="modal fade" id="openGrade" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document" >
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">开通班级</h4>
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						
							<div class="form-group ">
				           确定要开通<span id="bjCode_sp"></span>班吗?
							</div>
						
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">取 消</button>
						<a  id="open"  class="btn btn-xs btn-green">提交</a>
						
				</div>

			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->
	<!--详细信息的弹窗-->
		<div class="modal fade" id="xx" role="dialog"
		aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="gridSystemModalLabel">班级信息</h4>
					
				</div>
				<div class="modal-body">
					<div class="container-fluid">
						
							<div class="form-group ">
							   
								<div class="row " >
							
                                <div class='col-lg-10 col-md-10 col-sm-10 col-xs-10'>
                                <strong>
                                <span style="position:absolute;left: 7.5%;width:11%;text-align:center; "  >
		                                                                             姓名
		                         </span>
		                         <span style="position:absolute;left: 37.5%;width:11%;text-align:center; "  >
		                                                                             地址 
		                         </span>
		                         <span style="position:absolute;left: 67.5%;width:11%;text-align:center; "  >
		                                                                              手机号
		                         </span>
		                         <span style="position:absolute;left: 97.5%;width:11%;text-align:center; "  >
		                                                                              性别
		                         </span>
		                         </strong>
							     </div>
							     <br>
							     <div >
							     
							     <div class="row "  id="stuent_data">
							     
							     </div>
							     </div>
							</div>
							</div>
						
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-xs btn-white"
						data-dismiss="modal">关闭</button>
						
				</div>

			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->
<script type="text/javascript">
var codeInt="";
var indexPage="${grepage.index}";
var upPath="";
var campusid="${user.campusid}";
var roleid="${user.roleid}";
var gradeonid="";
var jobjl="<option value='22'>暂无</option>";
var jyjl="<option value='21'>暂无</option>";
var bzrjl="<option value='20'>暂无</option>";
$(function() {
	$("[name='openGrade']").click(function() {
		var id=$(this).attr("id").substring(2).trim();
		$("#bjCode_sp").text($("#gradeInp_select"+id).attr("name").trim()+$("#gradeInp_select"+id).val().trim());
		$("#bjCode_sp").attr("name",id);
		gradeonid=id;
		
	});
	$("[name='jumpAddStu']").click(function() {
		var id=$(this).attr("id").trim();
		var ids=id.split("/");
		window.location.href="${pageContext.request.contextPath }/TJXS?bj="+ids[0]+"&bm="+ids[1]+"&kc="+ids[2]+"&xq="+ids[3];
	});
	
	$("#open").click(function() {
		var bool=true;
		var teaName="#gradeTea_select"+gradeonid;
		var instName="#gradeInst_select"+gradeonid;
		var jobName="#gradejob_select"+gradeonid;
		var inputName="#gradeInp_select"+gradeonid;
		var codeInt=$(inputName).val().trim();
		var bzr=$(teaName).find("option:selected").text();
		var jy=$(instName).find("option:selected").text();
		var job=$(jobName).find("option:selected").text();
		if(codeInt.trim()==""){
			alert("班级编号不能为空！");
			bool=false;
		}else
		if(jy.trim()=="暂无"||jy.trim()=="无可担任课程的老师"){
			alert("教员老师不能为空！");
			bool=false;
		}else
		if(bzr.trim()=="暂无"||bzr.trim()=="无可担任课程的老师"){
			alert("班主任不能为空！");
			bool=false;
		}else
		if(job.trim()=="暂无"||job.trim()=="无可担任课程的老师"){
			alert("就业老师不能为空！");
			bool=false;
		}
		if(bool){
			window.location.href="${pageContext.request.contextPath }/GradeController/openGrade?gradeon="+gradeonid;
		}
	});
	$("#GraGetData_sub").click(function() {
		var url="${pageContext.request.contextPath }/AdmGrade?";
			url+="pageIndex=1"
				+"&xq="+$("#xq_grade").find("option:selected").text()
		        +"&xq_id="+$("#xq_grade").val()
		        +"&bm="+$("#bm_grade").find("option:selected").text()
		        +"&bm_id="+$("#bm_grade").val()
		        +"&bh="+$("#bh_grade").val()
		        +"&bh_id="+$("#bh_grade").val();
			    //教员
		        var selectText="";
		        selectText=$("#jy_select").find("option:selected").text();
		        if(selectText==null||selectText==""){
		        	url+="&jy="+$("#jy_input").val();
		        }else{
		        	url+="&jy="+$("#jy_select").find("option:selected").text();
		        }
		        url+="&jy_id="+$("[name='teacher_jy']").val();
		        //班主任
		        selectText=$("#bzr_grade").find("option:selected").text();
		        if(selectText==null||selectText==""){
		        	url+="&bzr="+$("#bzr_input").val();
		        }else{
		        	url+="&bzr="+$("#bzr_grade").find("option:selected").text();
		        }
		        url+="&bzr_id="+$("[name='teacher_bzr']").val();
		        //就业
		        selectText=$("#joy_select").find("option:selected").text();
		        if(selectText==null||selectText==""){
		        	url+="&job="+$("#joy_input").val();
		        }else{
		        	url+="&job="+$("#joy_select").find("option:selected").text();
		        }
		        url+="&job_id="+$("[name='teacher_joy']").val()
		        +"&kc="+$("#kc_grade").find("option:selected").text()
		        +"&kc_id="+$("#kc_grade").val()
		        +"&zt="+$("#zt_grade").find("option:selected").text()
		        +"&zt_id="+$("#zt_grade").val()
		        +"&px="+$("#px_order").find("option:selected").text()
		        +"&px_id="+$("#px_order").val()
		        +"&xl="+$("#px_by").text().trim()
		        +"&xl_id="+$("#px_by").attr("name");
				window.location.href=url;
	});
	
	$("#graSelectPage").change(function() {
		window.location.href="${pageContext.request.contextPath }/AdmGrade?pageIndex="+$(this).val()+"&xq=${sessionScope.xq}&xq_id=${sessionScope.xq_id}&bm=${sessionScope.bm}&bm_id=${sessionScope.bm_id}&bh=${sessionScope.bh}&bh_id=${sessionScope.bh_id}&jy=${sessionScope.jy}&jy_id=${sessionScope.jy_id}&bzr=${sessionScope.bzr}&bzr_id=${sessionScope.bzr_id}&job=${sessionScope.job}&job_id=${sessionScope.job_id}&kc=${sessionScope.kc}&kc_id=${sessionScope.kc_id}&zt=${sessionScope.zt}&zt_id=${sessionScope.zt_id}&px=${sessionScope.px}&px_id=${sessionScope.px_id}&xl=${sessionScope.xl}&xl_id=${sessionScope.xl_id}";
	});
	
	$("#graSelectPage").val(indexPage);
	
	$("#upGrade_sub").click(function() {
		window.location.href=upPath;
	});
	//教员输入框的切换按钮
	$("button[name='jy_but']").click(function() {
		var butStr = $(this).text().trim();
		if (butStr == "手动输入") {
			$(this).text("推荐选择");
			$("#jy_select").hide();
			$("#jy_input").show();
			$("#jy_input").attr("name", "teacher_jy");
			$("#jy_select").attr("name", "");
		} else {
			$(this).text("手动输入");
			$("#jy_input").hide();
			$("#jy_select").show();
			$("#jy_input").attr("name", "");
			$("#jy_select").attr("name", "teacher_jy");
		}
	});
	//班主任输入框的切换按钮
	$("button[name='bzr_but']").click(function() {
		var butStr = $(this).text().trim();
		if (butStr == "手动输入") {
			$(this).text("推荐选择");
			$("#bzr_grade").hide();
			$("#bzr_input").show();
			$("#bzr_input").attr("name", "teacher_bzr");
			$("#bzr_grade").attr("name", "");
		} else {
			$(this).text("手动输入");
			$("#bzr_input").hide();
			$("#bzr_grade").show();
			$("#bzr_input").attr("name", "");
			$("#bzr_grade").attr("name", "teacher_bzr");
		}
	});
	//就业老师输入框的切换按钮
	$("button[name='joy_but']").click(function() {
		var butStr = $(this).text().trim();
		if (butStr == "手动输入") {
			$(this).text("推荐选择");
			$("#joy_select").hide();
			$("#joy_input").show();
			$("#joy_input").attr("name", "teacher_joy");
			$("#joy_select").attr("name", "");
		} else {
			$(this).text("手动输入");
			$("#joy_input").hide();
			$("#joy_select").show();
			$("#joy_input").attr("name", "");
			$("#joy_select").attr("name", "teacher_joy");
		}
	});
	$("#kc_grade").change(function() {
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectJyAjax",
			data:{
				"campusid" : $("#xq_grade").val(),
				"courid" : $("#kc_grade").val()
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="<option value=''>全部</option>";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].teachername+"</option>";
				}
				$("#jy_select").html(htmlStr);
			},
			error : function(request) {
				alert(request.status);
			}
		});
	});
	//部门
	$("#xq_grade").change(function() {
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectDepaAjax",
			data:{
				"campusid" : $("#xq_grade").val()
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].departmentname+"</option>";
				}
				$("#bm_grade").html(htmlStr);
				$.ajax({
					type : "Post",
					url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectCoursesAjax",
					data:{
						"campusid" : $("#xq_grade").val(),
						"depaid" : $("#bm_grade").val()
					},
					dataType : "json",
					success : function(data) {
						
						var htmlStr="<option value=''>全部</option>";
						for (var i = 0; i < data.length; i++) {
							htmlStr+="<option value='"+data[i].id+"'>"+data[i].courseName+"</option>";
						}
						$("#kc_grade").html(htmlStr);
						
					},
					error : function(request) {
						alert(request.status);
					}
				});
				$.ajax({
					type : "Post",
					url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectBzrAjax",
					data:{
						"campusid" : $("#xq_grade").val(),
						"depaid" : $("#bm_grade").val()
					},
					dataType : "json",
					success : function(data) {
						
						var htmlStr="<option value=''>全部</option>";
						for (var i = 0; i < data.length; i++) {
							htmlStr+="<option value='"+data[i].id+"'>"+data[i].teachername+"</option>";
						}
						$("#bzr_grade").html(htmlStr);
					},
					error : function(request) {
						alert(request.status);
					}
				});
			},
			error : function(request) {
				alert(request.status);
			}
		});
	});
	$("#bm_grade").change(function() {
		if($("#bm_grade").val().trim()!=""&&$("#xq_grade").val().trim()!=""){
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectCoursesAjax",
			data:{
				"campusid" : $("#xq_grade").val(),
				"depaid" : $("#bm_grade").val()
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="<option value=''>全部</option>";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].courseName+"</option>";
				}
				$("#kc_grade").html(htmlStr);
				
			},
			error : function(request) {
				alert(request.status);
			}
		});
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectBzrAjax",
			data:{
				"campusid" : $("#xq_grade").val(),
				"depaid" : $("#bm_grade").val()
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="<option value=''>全部</option>";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].teachername+"</option>";
				}
				$("#bzr_grade").html(htmlStr);
			},
			error : function(request) {
				alert(request.status);
			}
		});
		}
		
	});
	$("#px_by").click(function() {
		var pxStr = $(this).text().trim();
		if (pxStr == "升序") {
			$(this).text("降序");
			$(this).attr("name", "desc");
		} else {
			$(this).text("升序");
			$(this).attr("name", "asc");
		}
	});
	$("[name='qx']").click(function() {
		var gradeno=$(this).attr("id");
		gradeno=gradeno.substring(2).trim();
		var teaName="#gradeTea_select"+gradeno;
		var jobName="#gradejob_select"+gradeno;
		var instName="#gradeInst_select"+gradeno;
		$(teaName).attr("style","cursor:default;width:60%;background-color: #F0F0F0;");
		$(instName).attr("style","cursor:default;width:60%;background-color: #F0F0F0;");
		$(jobName).attr("style","cursor:default;width:60%;background-color: #F0F0F0;");
		$("#updateGre"+gradeno).text("修改");
		$("#sc"+gradeno).hide();
		$(this).hide();
		var jobhtmlStr=jobjl;
		$(jobName).html(jobhtmlStr);
		var inshtmlStr=jyjl;
		$(instName).html(inshtmlStr);
		var teahtmlStr=bzrjl;
		$(teaName).html(teahtmlStr);
		$("#kb"+gradeno).show();
		$("#gradeInp_select"+gradeno).val("");
	});
	//校区的添加窗口
	$("#xq_add").change(function() {
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectDepaAjax",
			data:{
				"campusid" : $("#xq_add").val()
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].departmentname+"</option>";
				}
				$("#bm_add").html(htmlStr);
				$.ajax({
					type : "Post",
					url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectCoursesAjax",
					data:{
						"campusid" : $("#xq_add").val(),
						"depaid" : $("#bm_add").val()
					},
					dataType : "json",
					success : function(data) {
						
						var htmlStr="";
						for (var i = 0; i < data.length; i++) {
							htmlStr+="<option value='"+data[i].id+"'>"+data[i].courseName+"</option>";
						}
						$("#kc_add").html(htmlStr);
						
					},
					error : function(request) {
						alert(request.status);
					}
				});
				
			},
			error : function(request) {
				alert(request.status);
			}
		});
	});
	//部门的添加窗口
	$("#bm_add").change(function() {
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/SelectCoursesAjax",
			data:{
				"campusid" : $("#xq_add").val(),
				"depaid" : $("#bm_add").val()
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].courseName+"</option>";
				}
				$("#kc_add").html(htmlStr);
				
			},
			error : function(request) {
				alert(request.status);
			}
		});
	});
	$("#addGrade").click(function() {
		window.location.href="${pageContext.request.contextPath }/GradeController/addGrade?xq="+$("#xq_add").val()+"&bm="+$("#bm_add").val()+"&kc="+$("#kc_add").val();
	});
	$("#meGrade").click(function() {
		window.location.href="${pageContext.request.contextPath }/AdmGrade?phone=${user.phone}&phoneSelect=1";
	});
	$("[name='xx']").click(function() {
		var gradeno=$(this).attr("id");
		gradeno=gradeno.substring(2).trim();
		$.ajax({
			type : "Post",
			url : "${pageContext.request.contextPath }/GrandeAjaxController/getStuentDataByGradeon",
			data:{
				"gradeno" : gradeno
			},
			dataType : "json",
			success : function(data) {
				
				var htmlStr="";
				for (var i = 0; i < data.length; i++) {
					htmlStr+="<br><div class='col-lg-10 col-md-10 col-sm-10 col-xs-10'>";
					htmlStr+="<span style='position:absolute;left: 9.8%;width:18%;text-align:center; '  >"
					+data[i].studentName
					+"</span>"
					+"<span style='position:absolute;left: 36.5%;width:18%;text-align:center; '  >"
					+data[i].address
					+"</span>"
					+"<span style='position:absolute;left: 65%;width:18%;text-align:center; '  >"
					+data[i].phone
					+"</span>"
					+"<span style='position:absolute;left: 91.9%;width:18%;text-align:center; '  >"
					+data[i].sex
					+"</span> </div>";
				}
				$("#stuent_data").html(htmlStr);
				
			},
			error : function(request) {
				alert(request.status);
			}
		});
	});
	
});
function updateGre(gradeno){
	codeInt=$("#gradeInp_select"+gradeno).attr("placeholder");
	var upName="#updateGre"+gradeno;
	var teaName="#gradeTea_select"+gradeno;
	var instName="#gradeInst_select"+gradeno;
	var jobName="#gradejob_select"+gradeno;
	var inputName="#gradeInp_select"+gradeno;
	var campusid="${user.campusid}";
	var courid=$(instName).attr("name");
	var depaid=$(teaName).attr("name");
	if($(upName).text().trim()=="修改"){
		$("#kb"+gradeno).hide();
		$(upName).attr("data-toggle","");
		$(upName).attr("data-target","");
	$.ajax({
		type : "GET",
		url : "${pageContext.request.contextPath }/GrandeAjaxController/getTeachers",
		data:{
			"depa" : depaid,
			"campus" : campusid
		},
		dataType : "json",
		success : function(data) {
			var select= $(teaName).val().trim();
			htmlStr="<option value='20'>暂无</option>";
			for (var i = 0; i < data.length; i++) {
				
				if(select==data[i].id.toString().trim()){
					bzrjl="<option value='"+data[i].id+"'selected='selected' >"+data[i].teachername+"</option>";
					htmlStr+=bzrjl;
				}else{
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].teachername+"</option>";
				}
			}
            if(htmlStr==""){
            	htmlStr+="<option value='20'>无可担任课程的老师</option>";
			}
			$(teaName).html(htmlStr);
			$(teaName).attr("style","cursor:default;width:60%;");
		},
		error : function(request) {
			alert(request.status);
		}
	});
	$.ajax({
		type : "GET",
		url : "${pageContext.request.contextPath }/GrandeAjaxController/geIinsts",
		data:{
			"cour" : courid,
			"campus" : campusid
		},
		dataType : "json",
		success : function(data) {
			htmlStr="<option value='21'>暂无</option>";
			var select= $(instName).val().trim();
			for (var i = 0; i < data.length; i++) {
				
				if(select==data[i].id.toString().trim()){
					jyjl="<option value='"+data[i].id+"'selected='selected' >"+data[i].teachername+"</option>";
					htmlStr+=jyjl;
				}else{
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].teachername+"</option>";
				}
			}
			if(htmlStr==""){
				htmlStr+="<option value='21'>无可担任课程的老师</option>";
			}
			$(instName).html(htmlStr);
			$(instName).attr("style","cursor:default;width:60%;");
		},
		error : function(request) {
			alert(request.status);
		}
	});
	$.ajax({
		type : "GET",
		url : "${pageContext.request.contextPath }/GrandeAjaxController/getjob",
		data:{
			"campus" : campusid
		},
		dataType : "json",
		success : function(data) {
			htmlStr="<option value='22'>暂无</option>";
			var select= $(jobName).val().trim();
			for (var i = 0; i < data.length; i++) {
				
				if(select==data[i].id.toString().trim()){
					jobjl="<option value='"+data[i].id+"'selected='selected' >"+data[i].teachername+"</option>";
					htmlStr+=jobjl;
				}else{
					htmlStr+="<option value='"+data[i].id+"'>"+data[i].teachername+"</option>";
				}
			}
			$(jobName).html(htmlStr);
			$(jobName).attr("style","cursor:default;width:60%;");
		},
		error : function(request) {
			alert(request.status);
		}
	});

	$(upName).text("提交");
	$("#sc"+gradeno).show();
	$("#qx"+gradeno).show();
	}else{
		var bool=true;
		var codeInt=$(inputName).val().trim();
		var code=$(inputName).attr("name").trim()+codeInt;
		var bzr=$(teaName).find("option:selected").text();
		var jy=$(instName).find("option:selected").text();
		var job=$(jobName).find("option:selected").text();
		if(codeInt.trim()==""){
			alert("班级编号不能为空！");
			bool=false;
		}else
		if(jy.trim()=="暂无"||jy.trim()=="无可担任课程的老师"){
			alert("教员老师不能为空！");
			bool=false;
		}else
		if(bzr.trim()=="暂无"||bzr.trim()=="无可担任课程的老师"){
			alert("班主任不能为空！");
			bool=false;
		}else
		if(job.trim()=="暂无"||job.trim()=="无可担任课程的老师"){
			alert("就业老师不能为空！");
			bool=false;
		}
		if(bool){
		$("[name='UP_code']").val(code);
		$("[name='UP_bzr']").val(bzr);
		$("[name='UP_jy']").val(jy);
		$("[name='UP_job']").val(job);
		upPath= "${pageContext.request.contextPath }/GradeController/setGrade?gradecode="+$(inputName).attr("name").trim()+$(inputName).val().trim()
		+"&instructor="+$(instName).find("option:selected").val()+"&jobteacher="+$(jobName).find("option:selected").val()
		+"&teacher="+$(teaName).find("option:selected").val()+"&gradeno="+gradeno;
		$(upName).attr("data-toggle","modal");
		$(upName).attr("data-target","#upGrade");
		$(teaName).attr("style","cursor:default;width:60%;background-color: #F0F0F0;");
		$(instName).attr("style","cursor:default;width:60%;background-color: #F0F0F0;");
		$(jobName).attr("style","cursor:default;width:60%;background-color: #F0F0F0;");
		$(upName).text("修改");
		$("#sc"+gradeno).hide();
		$("#qx"+gradeno).hide();
		var jobhtmlStr=jobjl;
		$(jobName).html(jobhtmlStr);
		var inshtmlStr=jyjl;
		$(instName).html(inshtmlStr);
		var teahtmlStr=bzrjl;
		$(teaName).html(teahtmlStr);
		$("#kb"+gradeno).show();
		$(inputName).val("");
		}
	}
}

function getCode(code,gradeon) {
	$.ajax({
		type : "Post",
		url : "${pageContext.request.contextPath }/GrandeAjaxController/getCode",
		data:{
			"coursesid" : code
		},
		dataType : "text",
		success : function(data) {
			$("#gradeInp_select"+gradeon).val(data.trim());
		},
		error : function(request) {
			alert(request.status);
		}
	});
}
</script>






